CPP=g++
AR=ar
ARFLAGS=cur
IKSEMEL_INC=-I $(HOME)/install/include/
IKSEMEL_LIB=-L$(HOME)/install/lib/ -liksemel

CPPFLAGS=-O3 -Wall -fpic -fPIC -I. -Isrc/ $(IKSEMEL_INC) -D__NEED_DEBUG__=1
libpath=lib
bindriver=cc-cpp-client
compiledir=.obj

ifeq ($(verbose),1)
	E=echo
	V=
else
	E=@echo
	V=@
endif

OBJECTS=callBackImpl.o    \
					IoOps.o         \
					xmppBot.o       \
					xmppFilter.o    \

compileobjs=$(addprefix $(compiledir)/, $(OBJECTS))

.SUFFIXES: .cpp .o
.PHONY: all build_dirs shared static clean driver

vpath %.cpp src/
vpath %.h src/
#vpath %.o $(compiledir)/

all:build_dirs driver

driver:$(OBJECTS) main.o
	$(E) Building driver [$(bindriver)]
	$(CPP) -o $(bindriver) $(OBJECTS) main.o $(LDFLAGS) $(IKSEMEL_LIB)

.cpp.o:
	$(E) Compiling [$<]
	$(V)$(CPP) $(CPPFLAGS) -o $@ -c $<

build_dirs:

clean:
	$(E) Cleaning.
	$(V)rm -rf *.o $(bindriver)
